home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-03-22 | 1.4 KB | 55 lines |
- ' File manipulation by James Lanng for the AMOS PD library
-
- ' FCOPY procedure is for copying files, from the filename SOURCE$ to the
- ' destination file DESTINATION$, with the buffer in BUFFER in Kilobytes.
- ' i.e. "FCOPY["S:Startup-Sequence","RAM:Startup-Sequence",8]" would copy
- ' the startup sequence into RAM: with a buffer of 8K.
- '
- ' FMERGE is for merging two files, the first file is FIRST$, second SECOND$,
- ' and the destination is called DESTINATION$.
- ' i.e. "FMERGE["S:Startup-Sequence","S:Shell-startup","RAM:Startupfiles",8]
- ' would merge the startup sequence and shell startup into the ram disk, with
- ' a buffer of 8K.
-
- ' Please feel free to use these procedures within your own programs, no
- ' royalties are needed for commercial programs!
-
- Procedure FCOPY[SOURCE$,DESTINATION$,BUFFER]
- Open In 1,SOURCE$
- Open Out 2,DESTINATION$
- LF=Lof(1)
- Do
- Exit If P>=LF
- L=Min(BUFFER*1024,LF-P)
- A$=Input$(1,L)
- Print #2,A$;
- Add P,L
- Loop
- Close 1
- Close 2
- End Proc
- Procedure FMERGE[FIRST$,SECOND$,DESTINATION$,BUFFER]
- Open In 1,FIRST$
- Open Out 2,DESTINATION$
- LF=Lof(1)
- Do
- Exit If P>=LF
- L=Min(BUFFER*1024,LF-P)
- A$=Input$(1,L)
- Print #2,A$;
- Add P,L
- Loop
- Close 1
- Open In 1,SECOND$
- LF=Lof(1)
- P=0
- Do
- Exit If P>=LF
- L=Min(BUFFER*1024,LF-P)
- A$=Input$(1,L)
- Print #2,A$;
- Add P,L
- Loop
- Close 1
- Close 2
- End Proc